Chris Pollett >
Old Classes >
CS174 |
HW#1 --- last modified February 06 2019 04:13:04..Due date: Sep 14
Files to be submitted: Purpose: To write a short application that uses the HTTP protocol. To write a static, but relocatable, web site. Related Course Outcomes: The main course outcomes covered by this assignment are: CLO1 - Write HTML documents containing standard HTML elements including forms, tables, client-side scripts, and server-side scripts. Specification: This assignment will consist of three parts: To demo to me that you have install Apache, PHP, and Mysql, to write a short Java application to better understand HTTP and to write a small, relocatable web site.
Make sure to include in your For the first part of the assignment, I want you to install Apache, PHP, and Mysql on your laptop and configure it so I can see each of these things is running. You may choose to install MariaDB (a non-Oracle Mysql fork) instead or Mysql. If you decide (as I suggest) to install XAMPP to get stuff running, then I will test that your installation is working by going to the phpMyAdmin page. Demoing this to me either at the start of class or before I give out grades for this homework is worth 1/2 a point. Each person in a group must show me this for the group to receive this 1/2 point. In addition to installing these programs, it is useful for this class to have a simple text editor that can be configured to display whitespace characters such as spaces, tabs, end-of-lines and to indicate if the line is longer than 80 characters. The open-source editor gedit is available on Windows, Mac, and Linux and can do this. Also, for future homeworks I might get you to use git for version control, so it wouldn't hurt to try to install it early. For this homework, your Java program should be submitted as a single file PollettWebPageClient.java within the Hw1.zip that you submit. To test your code, the grader (probably me) will unzip your Hw1.zip and cd into that directory. Your program will then be compiled from the command line via the command: javac PollettWebPageClient.java using a version of Java SE as old as 1.7.0_51. Once compiled your program will be run using some variant of a line like: java PollettWebPageClient some_path Notice I am not adding any package info to the class I am running, and I am not switching into any sub directories of Hw1, so avoid package declarations and make sure to test from the command line, not within any IDE. Your program when run should use java.net.Socket to make a connection to port 80 of www.cs.sjsu.edu.
It should obtain a java.io.OutputStream from the constructed Socket and use this to make an HTTP/1.1 GET request for 174.23.16f/ masters/ index.php ../pollett/ You will notice in the web server's response that it sends the headers: Accept-Ranges, X-FRAME-OPTIONS, Transfer-Encoding. For each of these headers, note down the particular value given by the CS Department web server. In a file ResponseHeaders.txt that you should also include in Hw1.zip, write up a short explanation of what each of these headers is for and what each of the values given by the CS Department web server means. For the second part of the this homework, I want you to channel your inner crackpot and make a small web site about your favorite conspiracy theory.
This site should consist of at least three HTML 5 validating pages which you should place in a Point Breakdown
|